package main

import (
	"fmt"
	"go_final/mxshop_srvs/userop_srv/model"

	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"gorm.io/gorm/logger"
)

func main() {
	dsn := "root:root@tcp(120.24.67.46:4306)/mxshop_userop_srv?charset=utf8mb4&parseTime=True&loc=Local"

	db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{
		Logger: logger.Default.LogMode(logger.Info),
	})

	if err != nil {
		fmt.Println("err", err)
	}

	_ = db.AutoMigrate(
		&model.LeavingMessage{},
		&model.Address{},
		&model.UserFav{},
	)
}
